home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / pcpil / pidoc3.txt < prev    next >
Text File  |  1994-02-28  |  36KB  |  971 lines

  1.  
  2. FONT CHARACTER SPACING
  3.  
  4. Each character of a font has a pixel width associated with it. When the 
  5. character is displayed the text cursor advances by that width. The font also 
  6. has a line spacing value associated with it. The line spacing value 
  7. determines how many pixels are to occur between text lines (vertical 
  8. spacing). 
  9.  
  10.  
  11. FONT CHARACTER DISPLAY
  12.  
  13. In font display mode characters have transparent backgrounds. That is, only 
  14. pixels that are on are written to the screen. So a character cell around the 
  15. character is not cleared. The XOR writing mode can be set via the TYPE SCREEN 
  16. statement to cause characters to be blended with the current display. If XOR 
  17. writing mode is off then characters are painted over the display.  
  18.  
  19. Because of the way in which characters are displayed, it is possible to 
  20. overtype characters in a manner similar to on a typewriter producing the 
  21. combined effect of more than one character.  
  22.  
  23. To remove a character from the screen, position the cursor to the exact 
  24. location of the character, set the XOR writing mode (TS:O1) then type the 
  25. same character again.  
  26.  
  27. See also: NH:, Font Editor
  28.  
  29. NEW KEY - define keyboard codes
  30.  
  31.  
  32.        NX: x,y ; x,y . . .
  33.        NXS:
  34.  
  35. The NX: statement may be used to change the code generated by any key on the 
  36. keyboard. The normal codes generated are shown in appendix B. The number x 
  37. shown above stands for the normal default value of a key, the letter y stands 
  38. for the new value to be generated by the key. Both numbers are always in the 
  39. range 0 to 255. Any number of keys may be redefined in one NX: statement. 
  40. Each x,y pair is separated from the next by a semi-colon.  
  41.  
  42. Once a key has been redefined it affects all ACCEPT statements except those 
  43. with the X modifier. The X modifier on an ACCEPT statement causes any key re-
  44. definitions to be ignored for that ACCEPT.  
  45.  
  46. The NXS: statement causes all keyboard keys to revert to their default 
  47. values. NXS: undoes the effect of all previous NX: statements.  
  48.  
  49. EXAMPLE 1: new keys
  50.  
  51.        R: cause key f1 to generate code 225 (Beta)
  52.        NX: 187,225
  53.  
  54.        R: cause upper case A to give a-accent
  55.        NX: 65,160
  56.        . . .
  57.        R: restore upper case A to normal
  58.        NX: 65,65
  59.  
  60. See also:  ACCEPT
  61.     
  62. PROBLEM - set options
  63.  
  64.  
  65.        PR: option-list
  66.        P:  option-list
  67.        PS: list
  68.  
  69. PROBLEM has two uses.  The first is to provide a destination point for a J:@P 
  70. statement.  In this case PROBLEM can be put at the very end of each frame or 
  71. question.  The option list would usually be omitted in this case. If the 
  72. option list is omitted, then all options retain the settings prior to the 
  73. PROBLEM statement.  
  74.  
  75. The second use is to specify one or more lesson options.  Lesson options 
  76. control various aspects of student responses, such as automatic case 
  77. conversion of student answers or the student response time limit. Each option 
  78. can be set (turned on) or it can be reset (turned off).  
  79.  
  80. The option-list consists of one or more of the option letters below.  If the 
  81. S modifier is not appended to the op code, then all options not included in 
  82. the option-list are cleared or turned off.  If the S modifier is appended to 
  83. the op code (PS:), then options previously set remain set.  Each option is 
  84. then set if the corresponding letter is present in the option list. The 
  85. possible options are shown here.  
  86.  
  87. U  -  if set, all student responses translated to upper case 
  88.  
  89. L  -  if set, all student responses translated to lower case 
  90.  
  91. S  -  if set, all spaces are removed from student responses 
  92.  
  93. G  -  if set, the GOTO command is enabled
  94.  
  95. E  -  if set, the ESCAPE command is enabled
  96.  
  97. F  -  if set, the function key ESCAPE command is enabled 
  98.  
  99. I  -   if set,  error messages suppressed
  100.  
  101. Error messages are not displayed, but the E flag is still set. 
  102.  
  103. Kname  -  set KEEP file name
  104.  
  105. Sets the file name used by subsequent KEEP statements to name. name can be 
  106. any file or path name per DOS conventions.   
  107.  
  108. W  -  clear label table
  109.  
  110. Clears the label table and forgets about all labels passed so far.  Thus it 
  111. is impossible to jump backward.  This allows re-use of the same labels. (Not 
  112. recommended for use, present for compatibility only.) 
  113.  
  114. An  -  set answer maximum length
  115.  
  116. Sets maximum ACCEPT response length to n characters. n may be a number from 1 
  117. to 256.  A value of n less than 1 or greater than 256 sets the maximum 
  118. response length to 256.  
  119.  
  120. Z  -  causes U, L, S, G, P and E options to be turned off  
  121.  
  122. Tn  -  set answer time maximum
  123.  
  124. Set max Accept response time to n seconds, where 1<n<32767. T0 sets back to 
  125. no limit.  
  126.  
  127. P -  turn on printer echo
  128.  
  129. Turn "printer-echo" on. Once on then all characters typed to the display are 
  130. also sent to the system printer. It is up to the user to insure that the 
  131. printer is on and ready since the program can be delayed if it is not ready. 
  132. Use the Z option above to turn "printer-echo" off.  
  133.  
  134. Note:  The "R" of "PR:" may be omitted.  It is allowed for COMMON PILOT 
  135. compatibility.  
  136.  
  137. EXAMPLE 1: Problem statements 
  138.  
  139.        P: T10
  140.                              - response limit=10 sec
  141.        P: U S
  142.                              - upper case, spaces removed
  143.        P: F 
  144.                              - enable FUNCTION key escape
  145.        PS:G
  146.                              - set GOTO, leave others as before
  147.        P:P
  148.                              - turn printer-echo on
  149.  
  150. See also:  ACCEPT, KEEP, GOTO AND ESCAPE         
  151.  
  152. POKE,OUT - set memory or do output 
  153.  
  154.  
  155.        PX:offset,value
  156.        PJ:address,value
  157.  
  158. These statements are not normally used. They are provided for the programmer 
  159. who has need to program directly at the hardware level.  
  160.  
  161. The value must be a number or expression from  0 to 255. PX: stores the byte 
  162. value in memory at the offset given. The offset is from a segment whose base 
  163. is specified by the system variable %A. Great care must be taken in using 
  164. this statement as a mistake can cause system failure.  
  165.  
  166. PJ: Performs a machine level OUT instruction to the device address given of 
  167. the byte value.  
  168.  
  169. EXAMPLES: 
  170.  
  171. If you have both types of video adapters (monochrome and color) you can 
  172. switch from the monochrome to the color for PILOT output via ...  
  173.  
  174.        C: %A=0
  175.        PX: 1040,pek(1040)-16
  176.        (then set desired mode via TS: statement)
  177.  
  178. and you can change back to the monochrome via...  
  179.  
  180.        C: %A=0
  181.        PX: 1040,pek(1040)+16
  182.        (then set desired mode via TS: statement)
  183.  
  184. Note: the above example is given for illustration purposes only. The TS: 
  185. statement provides a simple way to change video adapters.  
  186.  
  187. REMARK - program comment
  188.  
  189.        R: remarks
  190.  
  191. REMARK is ignored during program execution.  It can be used to document a 
  192. PC/PILOT program.  
  193.  
  194. EXAMPLE:   
  195.  
  196.        R: This section displays the main menu.
  197.  
  198.  
  199. SOUND - generate tones
  200.  
  201.        S: list
  202.  
  203. SOUND is used to generate simple tones, noises or beeps for audio feedback.  
  204. The list contains one or more pitch or pitch,duration values.  The entries in 
  205. the list are separated by the ";" character.  The two possible forms of a 
  206. list entry are: 
  207.  
  208.        pitch
  209.        pitch, duration
  210.  
  211. where pitch is a number or variable from 0 to 2047 and duration is a number 
  212. or variable from 1 to 63.  A duration of 34 gives about a one second tone. 
  213. The lower the pitch value the higher the tone.  The higher the duration 
  214. value, the longer the tone is played.  If the duration is omitted after a 
  215. pitch (first form above) then the duration of the previous pitch is used. A 
  216. pitch or duration value can be an integer number, a variable name, or an 
  217. expression enclosed in parentheses.  
  218.  
  219. It is possible to repeat a series of notes by the notation: 
  220.  
  221.        *n(list)
  222.  
  223. where n is a number or a variable. A pitch value of 0 give silence. Normally, 
  224. doubling a pitch lowers it by one octave. Halving a pitch raises it by one 
  225. octave.  
  226.  
  227. EXAMPLES:
  228.  
  229.        S: 200,25;300,8;100,18   
  230.        S: *4(208,5;224)
  231.        R: next two lines play a two-octave scale
  232.        S: 500,10;446;400;374;333;301;266;250
  233.        S: 250,10;223;200;187;166;150;133;125
  234.  
  235. TYPE - display text on screen
  236.  
  237.  
  238.        T: text
  239.        TH: text
  240.        TX: text
  241.        : text
  242.  
  243. The TYPE statement is used to display text on the screen. TYPE might be used 
  244. to provide narrative, instructions, questions, feedback or computational 
  245. results. The data you place after the colon is displayed on the screen.  
  246.  
  247. EXAMPLE 1: simple TYPE statement
  248.  
  249.        T:We will now discuss stock options.
  250.  
  251. The text is always displayed within the currently defined viewport. Any 
  252. display data outside the current viewport is unaffected by the TYPE. The use 
  253. of a viewport is explained under the TYPE SCREEN statement. The text is 
  254. placed at the current cursor location, advancing the cursor, automatically 
  255. wrapping to the start of a new line if necessary.  Unless otherwise 
  256. specified, the cursor is returned to the start of the next line within the 
  257. viewport. If necessary, the viewport is scrolled up one line to accommodate 
  258. the text.  
  259.  
  260.  
  261. TYPE HANG, SUPPRESS NEW LINE
  262.  
  263. Appending the H, or hang, modifier to the TYPE, TH:, suppresses the automatic 
  264. return to the next line at the end of the text. Instead, the cursor is left 
  265. at the position immediately after the last displayed text character.  
  266.  
  267.  
  268. CURSOR POSITIONING
  269.  
  270. You can use the TS:, or TYPE SCREEN statement to move the cursor to any 
  271. desired screen location.  
  272.  
  273.  
  274. CLEARING THE SCREEN 
  275.  
  276. Appending the X, or clear, modifier to the TYPE, TX:, clears the viewport and 
  277. moves the cursor to home position prior to the text display. Home position is 
  278. the upper left corner of the viewport.  
  279.  
  280.  
  281. CONTINUATION OF A TYPE
  282.  
  283. A TYPE statement may be continued on the next line by starting the next line 
  284. with a colon. You may continue a TYPE in this manner for any number of lines.  
  285.  
  286. EXAMPLE 2: continuation of a TYPE
  287.  
  288.        T:Point D is the
  289.        :
  290.        :   A  mean
  291.        :   B  median
  292.        :   C  mode
  293.  
  294.  
  295. TYPING A $ OR A # CHARACTER
  296.  
  297. Since PILOT uses the $ and the # as special characters within a TYPE, to 
  298. actually display one of these characters, place two adjacent $ or # 
  299. characters in the text. For example 
  300.  
  301.        T:You owe $$5.00.
  302.  
  303. would actually display  "You owe $5.00." 
  304.  
  305.  
  306. TYPING VARIABLES OR EXPRESSIONS
  307.  
  308. You can type the value of a variable or an expression within the text. To 
  309. type the value of a variable precede the variable name by a "$" or a "#", and 
  310. follow the variable name by a space.  The value of the variable will be 
  311. displayed at the corresponding place. The name of the variable and the space 
  312. after the variable name are not displayed.  
  313.  
  314. EXAMPLE 3: variables in a TYPE
  315.  
  316.        T:You got #X  right.
  317.        might display    You got 37 right.
  318.  
  319.        T:This is an example of $ABC$  learning.
  320.        might display  
  321.        This is an example of cognitive learning.
  322.  
  323. In the first example, X is a numeric variable, whose value, 37, is 
  324. substituted in the displayed text. In the second example, ABC$ is a string 
  325. variable whose value, "cognitive", is substituted in the displayed text. Do 
  326. not be confused by the notation, $ABC$. The first $ indicates that a variable 
  327. is included in the text of a TYPE statement. The second $ is actually part of 
  328. the string variable name ABC$, since all string variable names end with a $.  
  329.  
  330. Programming note: By PILOT language convention, the $ is usually used to 
  331. precede a string variable and the # is used to precede a numeric variable. In 
  332. fact, this implementation of PILOT allows you to use either symbol for either 
  333. type of variable.  
  334.  
  335. The text may contain an expression preceded by a # or $ and enclosed in 
  336. parentheses.  The value of the expression is displayed in the text.  
  337.  
  338. EXAMPLE 4: expression within TYPE
  339.  
  340.        T:The total is #(A+B+C) .
  341.        might display    The total is 102.
  342.     
  343.  
  344. TEXT AND BACKGROUND COLORS
  345.  
  346. The current text and background colors can be changed within the text of a 
  347. TYPE. To set the text color put a # followed by a number. To set the 
  348. background color put a $ followed by a number. This facilitates the use of 
  349. color to highlight a word or phrase within a sentence. The number may be one 
  350. or two digits only.  
  351.  
  352. EXAMPLE 5: changing colors
  353.  
  354.        T:The #2 civil #3 war ended in $011865.
  355.  
  356. The word "the" is displayed in whatever the text color was prior to this 
  357. statement. The word "civil" is displayed in color 2, the word "war" is 
  358. displayed in color number 3. Note that 1865 is printed in background color 1. 
  359. Only the 01 makes up the background color number since it is two digits.  
  360.  
  361.  
  362. EXTENDED AND USER-DEFINED
  363.  
  364. CHARACTERS
  365.  
  366. All characters, from character code 32 to 255 can be displayed. Codes from 0 
  367. to 31 not reserved for control characters may also be displayed via a command 
  368. such as  T:$(CHR(25)).  Codes from 32 to 127 are the standard ASCII 
  369. characters. Character values from 128 to 255 are used in text modes for the 
  370. extended character set built into the computer. In graphics modes, codes 128 
  371. through 255 are available for user-defined characters.  
  372.  
  373.  
  374. CHARACTER FONTS
  375.  
  376. The NS: statement can be used to change to a character font for all text 
  377. output. Character fonts can be used to display characters of all sizes and 
  378. styles. See the NS: statement for more information on the use of character 
  379. fonts. 
  380.  
  381.  
  382. XOR TYPE MODE
  383.  
  384. In graphics modes 4, 5 and 6 the text can be displayed in one of two ways. 
  385. The normal way is to display the character in the character cell such that it 
  386. writes over the previous display data in the cell.  The second way is called 
  387. XOR mode. XOR causes the text to be combined with any display data that may 
  388. already be in the character cell on the screen. This is accomplished by a 
  389. logical exclusive or of the character pattern with the display screen. The 
  390. effect is to not obscure previous graphics data that may have been in the 
  391. character cell. Thus it would be possible to have a line or other graphic 
  392. element pass right through a character.  The TYPE SCREEN statement is used to 
  393. select the character writing mode.  
  394.  
  395.  
  396. CONTROL CHARACTERS
  397.  
  398. These cursor control characters may also be output by placing within an 
  399. expression or string variable.  
  400.  
  401.        CHR(8) =BACKSPACE
  402.        CHR(9) =FORWARD SPACE
  403.        CHR(10)=DOWN
  404.        CHR(11)=UP
  405.        CHR(12)=CLEAR
  406.        CHR(13)=NEWLINE
  407.        CHR(14)=HOME
  408.  
  409. DOWN and NEWLINE scroll the viewport up if the cursor is on the bottom line.  
  410. UP scrolls the viewport down if the cursor is on the top line.  
  411.  
  412.  
  413. See also:  TYPE SCREEN, NEW CHARACTER
  414.  
  415. TYPE SCREEN - set screen options
  416.  
  417.  
  418.        TS: command-list
  419.  
  420. TYPE SCREEN is used to control screen modes and colors, define viewports on 
  421. the screen, set line spacing and create animated character graphics.  
  422.  
  423. The command-list consists of one or more of the following commands.  Each 
  424. command is separated from the next by a ";" character.  In the command 
  425. descriptions below lower case letters denote a numeric variable, integer 
  426. constant, or an expression enclosed in parentheses.  
  427.  
  428. Mn - set mode
  429.  
  430. Set screen mode and erase screen. Screen modes are 0 through 6. On the IBM 
  431. EGA modes 13, 14 and 16 are also supported.  
  432.  
  433. MnC - set mode and select color adapter
  434.  
  435. Placing C after the number switches to the color adapter card.  
  436.  
  437. MnM - set mode and select monochrome adapter
  438.  
  439. Placing an M after the number switches to the monochrome adapter card. These 
  440. two options are only used if you have both types of display adapters and wish 
  441. to switch back and forth.  
  442.  
  443. Ln - set line spacing
  444.  
  445. Set spacing between text lines, n<=1 sets single spacing,  n=2 sets double 
  446. spacing, etc..  
  447.  
  448. Fn - set foreground color
  449.  
  450. Set foreground text color, possible values shown below.  
  451.  
  452. Fn,a - set color palette register
  453.  
  454. Supported only on EGA. Sets a color in the logical color palette register for 
  455. color number n.  Logical color n is set to actual color a. All display data 
  456. currently displayed in color n changes immediately to color a.  
  457.  
  458. Bn - set background color
  459.  
  460. Set background color, possible values shown below.  
  461.  
  462. En - erase to background color
  463.  
  464. Set background color and clear the current  viewport to the background color; 
  465. cursor set to home position in viewport.  
  466.  
  467. Rs,c,r - draw a rectangle outline
  468.  
  469. A rectangle is drawn with the upper left corner at the current cursor 
  470. location. The rectangle is c character cells wide and r character rows deep. 
  471.  
  472. In text mode, if the value for s is 1 or 2 then the rectangle is drawn with 
  473. the special line drawing characters of the extended character set, using the 
  474. appropriate horizontal, vertical and corner line characters. A value of 1 
  475. indicates single line characters, a value of 2 indicates double line 
  476. characters. A value of s=0 in text mode indicates that only blanks are 
  477. written. This implies that by setting the background color to the desired box 
  478. color a box of the background color is drawn.  
  479.  
  480. In graphics mode the value of s=0 indicates that the "*" character is to be 
  481. used to draw the box. A value of 1 or two indicates the use of the same 
  482. characters used in text mode to draw single and double line rectangles. But 
  483. since these characters are in the user-defined range, the actual border 
  484. character patterns used are as defined by the program. 
  485.  
  486. On - set overlay mode to xor or normal
  487.  
  488. Sets the graphics and text overlay mode to normal for n=0, or to XOR mode for 
  489. n=1.  Cn - control cursor 
  490.  
  491. Controls the cursor appearance. If n is zero, the cursor is invisible. If 
  492. using a text mode, then n=1 gives the normal underscore cursor, and n=2 gives 
  493. a block cursor. If using graphics mode, then n is the character number, from 
  494. 1 to 255 to be used as the cursor. The normal cursor is n=95, the underscore 
  495. character.  
  496.            
  497. Xn - set border color
  498.  
  499. In modes 0-3 sets color of the border or  outer  frame of  the  screen,  in 
  500. modes  4 and 5 has same effect as Bn,  in mode 6 sets the text color.  
  501.  
  502. Vl,r,t,b - select viewport
  503.  
  504. Set screen viewport to be from column l on the left through column r on the 
  505. right  and  from  row t  on  the  top through  row b on  the  bottom.   See 
  506. below for more information.  
  507.  
  508. V; - restore previous viewport
  509.  
  510. Restores the previous viewport and cursor position.  
  511.  
  512. Atext - animate text block
  513.  
  514. Animate: the text is displayed from the cursor position. If the text contains 
  515. a "/" character, the "/" is not displayed but the next character is displayed 
  516. on the next line down and directly under the original cursor location. Text 
  517. is displayed up to a ";" or to the end of the statement.  After the text is 
  518. displayed the cursor is left where it was when the animate began. This 
  519. command is useful to draw figures made up of a block of several redefined 
  520. characters.  
  521.  
  522. A$var$ - animate a string variable
  523.  
  524. Animate as described above using the contents of the string variable as the 
  525. text.  
  526.  
  527. Pn - select display page
  528.  
  529. Display text page n. In modes 0 and 1 n may be 0-7, in modes 2 and 3 n may be 
  530. 0-3, in modes 4-6 n may be 0 only. In the text modes (0-3) there are multiple 
  531. display pages, one of which is the currently visible page on the screen. The 
  532. normal default is PO.  
  533.  
  534. Pn,w - select display and writing page
  535.  
  536. Displays text page n but makes text page w the current page to be written on 
  537. by TYPE statements. Thus the student can view one page while the program 
  538. prepares another page for display. The TEXTWIPE utility (AFL) may be useful 
  539. in manipulating text pages.  
  540.  
  541. Dn - delay
  542.  
  543. Delay for n 60ths of a second. This is useful when using animate within a 
  544. loop to move a figure on the screen.  
  545.  
  546. Wrlud - walk cursor
  547.  
  548. Walk right, left, up or down. The W can be followed by any number of r, l, u, 
  549. or d characters. Each one moves the cursor one space in the indicated 
  550. direction.  Moving down on the bottom line of a viewport causes the viewport 
  551. to scroll up; moving up on the top line causes the viewport to scroll down.  
  552.  
  553. Gx,y - goto column, row
  554.  
  555. Position the cursor in column x and row y of the current viewport. G0,0 goes 
  556. to the home position of the viewport.  
  557.  
  558. *n(... ) - loop
  559.  
  560. Repeats the commands in parentheses n times. Any of the above commands may be 
  561. in the parentheses. This is useful to move a figure by repeating a sequence 
  562. of animate, delay and walk.  
  563.  
  564.  
  565. VIEWPORTS
  566.  
  567. A viewport is a section of the screen which is used to display all text 
  568. output by the program.  When PILOT starts the current viewport is defined to 
  569. be the entire screen (V0,39,0,24).  The Vl,r,t,b command defines a new 
  570. section of the screen to be the current viewport.  When this is done the 
  571. cursor is placed in the home position of the viewport.  All text displayed by 
  572. the program is displayed only in the current viewport, any data displayed 
  573. outside the viewport is unaffected as the viewport changes, clears, scrolls, 
  574. etc..  
  575.  
  576. A V command without the four numbers puts the viewport and cursor back to the 
  577. position prior to the last V command.  This simplifies alternating between 
  578. two viewports on the screen, and is useful for student responses and program 
  579. feedback.  Viewports are also useful to retain instructions, questions or 
  580. graphs outside a viewport while conversation takes place within the viewport.  
  581.  
  582. EXAMPLE 1: Establishing a viewport from column 5 through 
  583. column 30, and from row 18 through row 25, inclusive.  
  584.  
  585.        TS:V5,30,18,25
  586.  
  587.  
  588. SCREEN MODES
  589.  
  590. There are several possible screen modes. Each mode allows different screen 
  591. characteristics.  Modes 0 through 3 are called TEXT modes since only text, 
  592. not graphics, can be displayed in these modes. Modes with numbers 4 or higher 
  593. are called GRAPHICS modes since both text and graphics can be displayed.  
  594.  
  595.  
  596. TEXT MODES
  597.  
  598. In the text modes there are either 40 or 80 columns across.  There are always 
  599. 25 lines of text.  Each character cell has a unique background color, and a 
  600. foreground or text color. Characters from the standard ASCII and extended 
  601. character set can be displayed. There are 16 possible colors available.  
  602.  
  603. GRAPHICS MODES 
  604.  
  605. In the graphics modes there may be 40 columns or 80 columns, and 25 lines of 
  606. text. The text may consist of the standard ASCII characters or the 128 user-
  607. definable characters.  The background color is a screen-wide attribute, that 
  608. is, when the background color is selected, the entire screen background 
  609. changes immediately. In these modes, the GRAPHICS statement may be used to 
  610. draw turtle graphics or display full screen graphics images. There are two 
  611. possible 4-color sets, each with two possible intensities. 
  612.  
  613.   
  614. THE 16 AVAILABLE COLORS
  615.  
  616. There are 16 standard colors available. Some modes permit the display of all 
  617. 16 at once, others permit display of a subset of the colors. These color 
  618. numbers run from 0 to 15. The colors from 8 through 15 are brighter versions 
  619. of the same colors in the range 0 through 7. 
  620.  
  621.           0 - black
  622.           1 - blue
  623.           2 - green
  624.           3 - cyan
  625.           4 - red
  626.           5 - magenta
  627.           6 - brown
  628.           7 - grey
  629.  
  630. Color 14 (brighter brown) is yellow. Color 15 (brighter grey) 
  631. is white.
  632.  
  633.  
  634. MODES 0 AND 1
  635.  
  636. Text modes, 40 columns, 25 lines, text colors 0-15, background colors 0-7, 
  637. adding 8 to background causes blinking, no graphics, available on all 
  638. graphics adapters. Each character cell on the screen has its own background 
  639. and foreground attribute. When a character is written to the display the 
  640. character cell takes on the attribute according to the current foreground and 
  641. background settings. 
  642.  
  643.  
  644. MODES 2 AND 3
  645.  
  646. Text modes, 80 columns, 25 lines, text colors 0-15, background colors 0-7, 
  647. adding 8 to background causes blinking, no graphics, available on all 
  648. graphics and monochrome adapters. Each character cell on the screen has its 
  649. own color attributes as described above for modes 0 and 1. 
  650.  
  651.  
  652. MODES 4 AND 5
  653.  
  654. Graphics modes, 40 column text, 25 text lines, 320 pixels across, 200 pixels 
  655. down, text and graphics colors 1,2 and 3. Background color is color 0. It may 
  656. be set to a value from 0 to 16. Adding 16 to the background color number 
  657. gives a higher intensity off all the colors on the screen. When the 
  658. background changes, the entire screen's background changes immediately. Text 
  659. may be displayed via the hardware character set, user-defined characters or 
  660. character fonts. All types of graphics available.  
  661.  
  662.  
  663. COLORS IN MODE 4
  664.  
  665.           0 - current background color
  666.           1 - GREEN
  667.           2 - RED
  668.           3 - YELLOW
  669.  
  670. Note: lower intensity YELLOW becomes BROWN. 
  671.  
  672.  
  673. COLORS IN MODE 5
  674.  
  675.           0 - current background color
  676.           1 - CYAN
  677.           2 - MAGENTA
  678.           3 - WHITE
  679.  
  680.  
  681. MODE 6
  682.  
  683. Graphics mode, 80 column text, 25 text lines, 640 pixels across, 200 pixels 
  684. down, background color is 0 (black), foreground color is 1, normally white, 
  685. can be set via TS:Xn command. Text may be displayed via hardware character 
  686. set, user-defined characters or character fonts. All types of graphics 
  687. available. 
  688.  
  689.  
  690. EXTENDED GRAPHICS ADAPTER
  691.  
  692. When using the IBM EGA there are several additional functions which can be 
  693. utilized. The EGA provides higher resolution, more colors and 80 column text 
  694. with 16 color graphics. The EGA also permits the modification of the colors 
  695. assigned to the 16 standard color numbers via control of the color palette. 
  696. In the EGA modes image graphics, sprites and user-defined characters are not 
  697. supported.  Character fonts are supported. Three additional screen modes are 
  698. supported. Selection of one of the EGA modes on a non-EGA system can give 
  699. unpredictable results.  The EGA supports modes 0 through 6 as described 
  700. above.  
  701.  
  702.  
  703. MODE 13
  704.  
  705. Graphics mode, 40 column by 25 line text. Graphics is 320 across by 200 down. 
  706. Colors are 0-15 for text and graphics. Text may be displayed via hardware 
  707. character set or character fonts. Turtle graphics can be used.  Image and 
  708. sprite graphics can not be used.  
  709.  
  710.  
  711. MODE 14
  712.  
  713. Graphics mode, 80 column by 25 line text. Graphics is 640 across by 200 down. 
  714. Colors are 0-15 for text and graphics. Text may be displayed via hardware 
  715. character set or character fonts. Turtle graphics can be used.  Image and 
  716. sprite graphics can not be used.  
  717.  
  718.  
  719. MODE 16
  720.  
  721. Graphics mode, 80 column by 25 line text. Graphics is 640 across by 350 down. 
  722. Colors are 0-15 for text and graphics.  Text may be displayed via hardware 
  723. character set or character fonts. Turtle graphics can be used.  Image and 
  724. sprite graphics can not be used.  
  725.  
  726.  
  727. EGA COLOR PALETTE
  728.  
  729. The EGA has logical color registers, or a color palette, as it is called. 
  730. There are 16 logical color registers which correspond to the sixteen logical 
  731. colors 0-15. Each register may contain an actual color number from 0 to 63 
  732. which tells what visible color is displayed for the logical color. The color 
  733. registers are active in all screen modes and can be set via the TS:Fn,a 
  734. command shown above. Changing the actual color for a logical color in which 
  735. data is currently displayed causes the display to change immediately. This 
  736. can be used to your advantage to create dynamic displays.  
  737.  
  738.  
  739. NORMAL AND XOR WRITING MODES
  740.  
  741. In graphics modes 4, 5 and 6 the text and turtle graphics can be displayed in 
  742. one of two ways.  The normal way is for text characters to replace the entire 
  743. character cell with the character and graphics output to replace each pixel. 
  744. An alternate way can be selected via the TS:O1 command shown above. XOR mode 
  745. causes a character or graphic element to be combined with the current display 
  746. data via a logical exclusive or operation. Using this mode a text character 
  747. can be placed over a graphic display without obscuring an entire 8 by 8 pixel 
  748. character cell.  Two characters can also be displayed in one character cell, 
  749. giving the effect of an overstrike capability. Two lines can intersect, 
  750. showing the point of intersection in the combined colors.  
  751.  
  752.  
  753. CHARACTER ANIMATION
  754.  
  755. The TS: statement can be used to construct animated 
  756. sequences by moving blocks of characters on the screen. 
  757. For more sophisticated animation it is recommended that 
  758. you use sprite animation, explained in the SPRITES section 
  759. of this document.  
  760.  
  761. This example shows how to move a figure across the screen left to right then 
  762. right to left. The figure is a 4 letter block: 
  763.  
  764.        WX
  765.        YZ
  766.  
  767. However, it could be any user defined characters as well.  Notice that the 
  768. animation string is carefully laid out with spaces to insure that each redraw 
  769. of the figure completely overtypes the previous one so a trail is not left 
  770. behind.  The number after the D controls the speed of motion.  
  771.  
  772. EXAMPLE 2: animate a block of characters
  773.  
  774.        TS:M1;B0;F1;*20(A WX/ YZ;WR;D5)
  775.        TS:*20(WL;AWX /YZ ;D5)
  776.  
  777. MONOCHROME ADAPTER CARD
  778.  
  779. The various modes and colors apply only to the color adapter card.  On a 
  780. monochrome adapter the screen always works in 25 by 80 mode. It is 
  781. recommended that you use only mode 2 if your program is to run on a 
  782. monochrome adapter.  
  783.  
  784. See also:  TYPE, GRAPHICS
  785.                        
  786. USE - call a subroutine
  787.  
  788.  
  789.        U: destination
  790.  
  791. The USE statement is used to call a subroutine.  
  792.  
  793. USE jumps to the destination and saves the location of the statement after 
  794. the USE on the use-stack.  A subsequent END statement in the subroutine 
  795. causes a return to the statement after the USE.  
  796.  
  797. The destination can be any of those described for JUMP, though the only one 
  798. which normally makes sense is a statement label.  
  799.  
  800. USE statements can be nested. That is, a subroutine can call another 
  801. subroutine with another USE statement. The maximum nesting level is 32 levels 
  802. deep.  
  803.  
  804. USE is similar to gosub in basic.  
  805.  
  806. EXAMPLE: a subroutine call
  807.  
  808.        T:Typed first
  809.        U:GLOSS
  810.        T:Typed fourth
  811.        E:
  812.        . . .
  813.        *GLOSS
  814.        T:Typed second
  815.        T:Typed third
  816.        E:
  817.  
  818. EXAMPLE 2: String variable contains the name of             the subroutine to 
  819. call. 
  820.  
  821.        X:"U:" !! X$
  822.  
  823. See also;  END, JUMP
  824.                          
  825. VIDEO - call external driver program
  826.  
  827.  
  828.        V: variable$
  829.  
  830. VIDEO is intended to allow a PILOT program to call a machine language 
  831. subroutine. It was originally used to call interface routines for video disc 
  832. and tape players. However, it could be used for many other purposes, since it 
  833. is actually a general purpose interface to any machine language program. (In 
  834. fact, most video devices do not need this type of driver program and can be 
  835. controlled directly by output from the FILE OUT statement.) 
  836.  
  837. The only argument of a VIDEO statement is the name of a string variable.  The 
  838. string variable must have been dimensioned long enough to contain the machine 
  839. language subroutine and the subroutine must have been placed into the string. 
  840. The DX: op code must be used to dimension the string variable. This insures 
  841. that the string begins on a 16-byte boundary.  
  842.  
  843. The VIDEO statement causes the machine language FAR CALL to be executed to 
  844. the first byte of the string. Upon entry to the subroutine the code segment 
  845. and data segment registers are equal and point to a segment which contains 
  846. the subroutine at offset zero.  Segment registers must not be modified upon 
  847. return from the subroutine. Other registers may be used without saving the 
  848. contents. The subroutine must return via a FAR RETURN op-code. Data can be 
  849. passed to/from the subroutine by the PILOT program in mutually decided 
  850. portions of the string variable itself.  The PILOT program can use 
  851. subscripting to deposit or fetch data in the locations within the string 
  852. designated by the subroutine.  
  853.  
  854. A good way to get the subroutine into the string variable is to read it from 
  855. a disk file as shown in the first example below.  The machine language code 
  856. must be in memory image format and must be position independent since it may 
  857. be loaded anywhere.  Naturally, care should be taken in using this statement 
  858. as improper use can cause system failure. The DOS utility called EXE2BIN may 
  859. be of use in preparing the subroutine file.  
  860.  
  861. Programming note: Since PILOT string variables are always terminated by a 
  862. null character, ( a zero byte) you may need to avoid placing zero bytes 
  863. within the data passed to and from the machine language subroutine. A zero 
  864. byte would look like the end of the string when using subscripting to access 
  865. bytes within the string.  
  866.  
  867. EXAMPLE: Using the EXEC program of the Advanced Feature Library to execute 
  868. another DOS program as a subroutine. 
  869.  
  870.        DX: EXEC$(600)
  871.        FX: EXEC.BIN
  872.        FI: 0,EXEC$
  873.        C: EXEC$(9,80) = "TURBO XYZ"
  874.        V: EXEC$
  875.  
  876. See also:  sample program SAMPLE4.PIL
  877.  
  878. WAIT - program delay
  879.  
  880.        W: expression
  881.        WH:expression
  882.  
  883. WAIT causes a program delay for expression tenths of a second.  The delay is 
  884. prematurely ended if the student pushes a key.  
  885.  
  886. EXAMPLE 1: WAIT 10 seconds or until a key is hit 
  887.  
  888.        W:100
  889.  
  890. WAIT AND HOLD
  891.  
  892. Normally, if the WAIT is ended by the student pushing a key, the value of the 
  893. keypress is discarded and the program continues. Appending the H, or HOLD, 
  894. modifier to the WAIT changes this.  If the student pushes a key, the WH: 
  895. statement is ended, but the keypress is not discarded. Instead, it is left in 
  896. the type-ahead buffer so that it can be read by a subsequent ACCEPT 
  897. statement, or KEY function.  
  898.  
  899. EXAMPLE 2: WAIT HOLD. This example shows a typical use for WAIT. At a pause 
  900. point within the program the student is instructed to push a key to go on. 
  901. The WH:30000 would wait essentially forever. When the student pushes a key, 
  902. the WH: ends and the  KEY function is used to see what key was pushed.  If it 
  903. is the ESC key, then the SYSX routine is called in much the same manner as it 
  904. would be called automatically by an ACCEPT.  
  905.  
  906.        T:Push any key to go on.
  907.        WH:30000
  908.        U(KEY(0)=27):SYSX
  909.  
  910. Programming note: The TS:Dn command may be used to force a delay which can 
  911. not be interupted by the keyboard. 
  912.   
  913. EXECUTE INDIRECT - execute a string
  914.  
  915.  
  916.        XI: expression
  917.        X: expression
  918.  
  919. EXECUTE INDIRECT allows you to construct a PILOT statement within a string, 
  920. then execute the statement. This very unique language feature turns out to be 
  921. an extremely powerful programming tool.  
  922.  
  923. EXECUTE INDIRECT evaluates the expression to its string value.  Then the 
  924. string value is executed as if it were a PILOT statement.  The string may 
  925. contain any valid statement up to length 255. If the string is too long only 
  926. the first 255 characters are used.  
  927.  
  928. Programming note: The "I" of "XI" may be omitted; it is allowed for 
  929. compatibility with other versions of PILOT.  
  930.  
  931. EXAMPLE 1: Random problem selection. Assume that there are 10 problems, each 
  932. with a label PROB0, PROB1, etc. This statement could be used to select one at 
  933. random.  
  934.  
  935.        X: "J:PROB" !! RND(10)
  936.  
  937.  
  938. EXAMPLE 2: Save a frequently used graphic sequence in a string for repeated 
  939. use.  
  940.  
  941.        C: BOX$="G:*4(F50;R90;F100;R90)"
  942.        ...
  943.        X: BOX$
  944.  
  945.  
  946. EXAMPLE 3: Save viewport parameters in strings to simplify switching among 
  947. several viewports.  
  948.  
  949.        C:QUES$ = "TS:V0,18,3,17;B1;F3"
  950.        C:ANSW$ = "TS:V20,38,5,9;B2;F4"
  951.        . . .
  952.        X: QUES$
  953.        T: What is the Magna Carta?
  954.        X: ANSW$
  955.        A:
  956.  
  957.  
  958. EXAMPLE 4: A desk calculator constructed via the EXECUTE INDIRECT statement.  
  959.  
  960.        *DESK
  961.        TH:Enter an expression here: 
  962.        A:
  963.        X: "C: X = " !! %B
  964.        T:The result is #X
  965.        J:DESK
  966.  
  967.  
  968. See Also: SAMPLE1.PIL 
  969.  
  970.  
  971.